Skip to content

[deprecation] Deprecate RemoveAnnotationRector - #8345

Merged
TomasVotruba merged 1 commit into
mainfrom
deprecate-remove-annotation-rector
Aug 10, 2026
Merged

[deprecation] Deprecate RemoveAnnotationRector#8345
TomasVotruba merged 1 commit into
mainfrom
deprecate-remove-annotation-rector

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Removing an annotation by its name is a coding standard concern, not an upgrade path.

The rule is not part of any set - neither in rector-src config/set/, nor in rector-symfony, rector-doctrine, rector-phpunit, rector-laravel or drupal-rector. It only ever shows up in hand-written project configs, where a coding standard tool handles the same job better.

What the rule did:

$rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['method']);
-/**
- * @method getName()
- */
 final class SomeClass
 {
 }

Follows the same shape as the recently deprecated rules - DeprecatedInterface, refactor() throws, tests removed.

PhpDocTagRemover::removeByName() is kept and marked @api phpunit, as rector-phpunit still calls it in ExceptionAnnotationRector and ReplaceTestAnnotationWithPrefixedFunctionRector.

@TomasVotruba
TomasVotruba force-pushed the deprecate-remove-annotation-rector branch from 13d726b to c0a9a35 Compare August 10, 2026 22:08
@TomasVotruba
TomasVotruba merged commit d2a983e into main Aug 10, 2026
52 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-remove-annotation-rector branch August 10, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant